#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdbool.h>
typedef int QDataType;
typedef struct Queue
{
	QDataType* arr;
	int head;
	int rear;
	int size;
}Queue;
void Initial(Queue* q, int size)
{
	q->arr = (QDataType*)malloc(sizeof(QDataType) * size+1);
	q->head = 0;
	q->rear = 0;
	q->size = size;
}
void PushQueue(Queue* q, int x)
{
	q->arr[q->rear] = x;
	q->rear = (q->rear + 1) % (q->size+1);	
}
void PopQueue(Queue* q)
{
	if (q->head == q->rear)
	{

	}
	else
	{
		q->head = (q->head + 1) %( q->size+1);
	}
}
void print(Queue* q)
{
	while (q->head != q->rear)
	{
		printf("%d ",q->arr[q->head]);
		PopQueue(q);
	}
}
void yanghui(Queue* q, int x)
{
	int i = 0;
	for (i=1; i <= x; i++)
	{
		PushQueue(q, 1);
		int j = i-1;
		int a = q->arr[q->head];
		printf("%d ", a);
		PopQueue(q);
		PushQueue(q, 1);

		for (j; j > 0; j--)
		{
			int b = q->arr[q->head];
			printf("%d ", b);

			PopQueue(q);
			a = a + b;
			PushQueue(q, a);
			a = b;
		}
		printf("\n");
	}
}
int main()
{
	int n;
	scanf("%d", &n);
	Queue q;
	Initial(&q,n);
	yanghui(&q, q.size);
}